﻿#include <Sys\RenderUnit\SysRenderDatagram\ANCHORRD.HPP>

#define CAnchor_ClassID L"F8DE5870C6034169B083F14035AC8DCB"

using namespace CxxlMan;
using namespace Cxxl3D;

cxxlObject *cxxlFASTCALL New_CAnchorRD();
cxxlPreserve2 *cxxlFASTCALL Regenera_CAnchorRD(const wchar_t *ClassID);


class CAnchorRD:public IAnchorRD
{
protected:
  // 儲存容器藉此取得要永續存取的屬性資料
  // 延伸類別須以 virtual 的形式覆寫
  // 並且須呼叫上層類別的此函數
  virtual bool cxxlFASTCALL Ref(Filter *F)
  {
    if(F != NULL && IAnchorRD::Ref(F))
      return true;
    else
      return false;
  }

public:
  // Constructor
  CAnchorRD()
    :cxxlObject(CxxlMan::Spirit_Easy),    
    cxxlPreserve2(CAnchor_ClassID) // 在建構時指定 ClassID
  {
  }
  virtual ~CAnchorRD()
  {
  }

  friend cxxlObject *cxxlFASTCALL New_CAnchorRD();
  friend cxxlPreserve2 *cxxlFASTCALL Regenera_CAnchorRD(const wchar_t *ClassID);

};

cxxlObject *cxxlFASTCALL New_CAnchorRD()
{
  return new CAnchorRD();
}

cxxlPreserve2 *cxxlFASTCALL Regenera_CAnchorRD(const wchar_t *ClassID)
{
  if(wcscmp(CAnchor_ClassID, ClassID) == 0)
    return new CAnchorRD;
  else
    return NULL;

}
